#pragma once
#include "SystemPCH.h"
namespace CAT
{

template<class T>
class List
{
public:
	class Node
	{
		friend class List<T>;
	public:
		Node( void );
		Node( const T& );
		Node( const Node& );
		bool  operator == ( const  Node& ) const;
		~Node( void );

	public:
		T&				GetElement		( void );
		const T&		GetElement		( void ) const;
		Node*           GetNext			( void );
		const Node*     GetNext			( void ) const;

	private:
		void			SetElement		( const T&    $element );
		Node*			AddNode			( const Node& $element );
		Node&           operator =      ( const Node& );

	private:
		Node* next;
		T     element;
	};
public:
		  List( void );
		  List( const List<T>& );
		  List( const  Node& );
		 ~List( void );
	      List<T>& operator =  ( const List<T>& $rsh );

public:
	int			Size    		( void ) const;
	Node*       Head            ( void ) const;
	Node*       Tail            ( void ) const;
	void        Append          ( const Node& $element );
	void		AddHead         ( const Node& $element );
	Node*       Insert          ( Node* pos, const Node& $element );

private:
	 Node*   head;
	 Node*   tail;
};
#include "List.inl"
}